<?php
$_d = getcwd();
ob_start();
$_GET['p'] = $_POST['p'] = 'index';
$_GET['id'] = $_POST['id'] = '{id}';
chdir('../../../');
include('index.php');
$out = ob_get_contents();
chdir($_d);
if (file_exists('index.html')) unlink('index.html');
file_put_contents('index.html',$out);
ob_end_flush();
?>